runOnStartup(async runtime => {
    var buttonClass = runtime.objects.Button
    buttonClass.addEventListener("instancecreate", (e) => {
        /**
         * @type {ISpriteInstance}
         */
        let getButton = e.instance
        //console.log(getButton)
        var buttonText = runtime.objects.ButtonInText
        var textInstance = buttonText?.createInstance(getButton.layer.name, getButton.x, getButton.y, true)
        textInstance.text = getButton?.instVars.text
        textInstance.zElevation = 1
        getButton.addChild(textInstance,{
            transformX: true,
            transformY: true,
            transformWidth: false,
            transformHeight: false,
            transformAngle: true,
            transformZElevation: true,
            destroyWithParent: true
        })
        //console.log(textInstance)

    })
    window.addEventListener("Button2Tick", (e) => {

    })
    window.addEventListener("Button2Init", (e) => {


    })
});
globalThis.Button2_Button2ShowTextInButton = {}

export default Button2_Button2ShowTextInButton